package com.material.vtool.mapper;

import com.material.vtool.entity.BMaterialTypeInfoEntity;
import com.material.vtool.entity.combinedEntity.CombinedCommonArticleEntity;
import com.material.vtool.entity.combinedEntity.CombinedRecommendArticleEntity;
import com.material.vtool.entity.combinedEntity.HotSearch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface MaterialInfoMapper {
    List<CombinedRecommendArticleEntity> getRecommendArticleByTime(@Param("materialTypeIds") List<Integer> materialTypeIds);

    Integer getRecommendArticleByTimeTotal(@Param("materialTypeIds") List<Integer> materialTypeIds);

    List<CombinedRecommendArticleEntity> getRecommendArticle(@Param("materialTypeIds") List<Integer> materialTypeIds);

    List<CombinedCommonArticleEntity> getArticleByMaterialTypeId(@Param("materialTypeId") Integer materialTypeId);

    Integer getArticleByMaterialTypeIdTotal(Integer materialTypeId);

    List<HotSearch> getHotSearch(String miniCode);

    List<CombinedCommonArticleEntity> searchMaterialByKey(@Param("miniCode") String miniCode, @Param("key") String key);

    Integer searchMaterialByKeyTotal(@Param("miniCode") String miniCode, @Param("key") String key);

    BMaterialTypeInfoEntity getMaterialTypeByMaterialId(Integer materialId);

    Integer increaseCollectCount(Integer materialId);

    Integer increaseDownloadCount(Integer materialId);

    Integer increaseShareCount(Integer materialId);

    CombinedCommonArticleEntity getMaterialInfoById(Integer materialId);
}
